package com.gking.centerSystem.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gking.centerSystem.common.Result;
import com.gking.centerSystem.entity.AccessRejectionCollect;
import com.gking.centerSystem.service.AccessRejectionCollect.AccessRejectionCollectService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/accessRejectionCollect")
public class AccessRejectionCollectController {

    @Resource
    AccessRejectionCollectService accessRejectionCollectService;


    /**
     * 分页获取受控访问记录
     *
     * @param accessRejectionCollect 筛选条件
     * @param page                   分页页码
     * @param size                   分页大小
     * @return p
     */
    @RequiresPermissions("CS:manager:get:accessRejection")
    @PostMapping("/getList")
    public Result<Page> getRejectionCollect(@RequestBody AccessRejectionCollect accessRejectionCollect,
                                            @RequestParam Integer page, @RequestParam Integer size) {
        if (page == null || size == null) return Result.error("请将参数补充完整");
        return accessRejectionCollectService.getRejectionCollect(accessRejectionCollect, page, size);
    }

}
